Skip to content

Update go dependencies, coverage, static analysis and lint updates#1529

Merged
jehiah merged 2 commits into
nsqio:masterfrom
jehiah:go_deps_1529
Jul 20, 2026
Merged

Update go dependencies, coverage, static analysis and lint updates#1529
jehiah merged 2 commits into
nsqio:masterfrom
jehiah:go_deps_1529

Conversation

@jehiah

@jehiah jehiah commented Jun 2, 2026

Copy link
Copy Markdown
Member

Go dependency & toolchain modernization

Brings the build, tooling, and code up to date with current Go and its stricter static analysis.

Dependencies & toolchain

  • Bump go.mod to Go 1.25 and update dependencies (BurntSushi/toml, go-hostpool, golang/snappy v1, blang/semver/v4, stretchr/testify, golang.org/x/sys).
  • CI: test against Go 1.25/1.26 on ubuntu-latest, and refresh GitHub Actions (checkout@v7, setup-go@v7) to keep the pipeline running on supported runners.

Linting

  • Replace the standalone staticcheck action with golangci-lint (v2.12) in CI, giving broader coverage (errcheck, etc.) in one tool.

Static-analysis fixes

  • Address the findings the new linter surfaces — primarily previously-ignored error returns across nsqd, nsqadmin, nsqlookupd, internal/, and apps/ (checking or explicitly discarding them). A few carry real behavior improvements, e.g. RespondV1 now marshals a proper JSON error body on marshal failure instead of writing a bare error.

Coverage

  • Switch code coverage from the goveralls install-and-script approach to the maintained coverallsapp/github-action.

Test & fixture fixes

  • TestReconfigure: carry BroadcastTCPPort/BroadcastHTTPPort onto the swapped-in options so the nsqd→nsqlookupd IDENTIFY includes non-zero ports (mirrors how real config reload copies current opts) — previously the test failed with IDENTIFY missing fields.
  • Regenerate TLS test certs with explicit rsa:2048/sha256, since the old fixtures no longer satisfy newer Go TLS defaults.

@jehiah jehiah self-assigned this Jun 2, 2026
@jehiah jehiah added the chore label Jun 2, 2026
@jehiah
jehiah force-pushed the go_deps_1529 branch 2 times, most recently from b9a56ca to fae6720 Compare July 16, 2026 14:41
@jehiah jehiah changed the title Go: update dependencies Update go dependencies, coverage, static analysis and lint updates Jul 16, 2026
@jehiah
jehiah requested a review from Copilot July 16, 2026 15:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the project’s Go toolchain and CI/linting stack, then applies the mechanical code updates needed to satisfy stricter vet/static analysis (primarily checking or explicitly discarding error returns) while also refreshing tests/fixtures.

Changes:

  • Update Go module/tooling and refresh CI to newer Go versions, golangci-lint, and Coveralls action-based coverage.
  • Fix newly surfaced static-analysis issues across servers, apps, and internals (error handling, deadlines, close/flush semantics, deprecated APIs).
  • Regenerate TLS fixtures and adjust tests to match newer Go/runtime expectations.

Reviewed changes

Copilot reviewed 75 out of 76 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test.sh Runs go test with -vet=all and removes separate go vet invocation.
nsqlookupd/tcp.go Adds error-aware closes and response send logging.
nsqlookupd/nsqlookupd.go Logs listener close failures during shutdown.
nsqlookupd/nsqlookupd_test.go Stops ignoring network/write/close errors in tests.
nsqlookupd/http.go Updates http_api.Err literals to keyed fields.
nsqlookupd/http_test.go Stops ignoring response-body close errors and tempdir cleanup.
nsqd/topic.go Propagates/handles errors for topic/channel delete/empty/flush paths.
nsqd/topic_test.go Stops ignoring filesystem cleanup and message put errors; simplifies busy-waits.
nsqd/test/certs/server.req Regenerated TLS CSR fixture.
nsqd/test/certs/server.pem Regenerated server certificate fixture.
nsqd/test/certs/server.key Regenerated server private key fixture (PKCS8).
nsqd/test/certs/client.req Regenerated TLS CSR fixture.
nsqd/test/certs/client.pem Regenerated client certificate fixture.
nsqd/test/certs/client.key Regenerated client private key fixture (PKCS8).
nsqd/test/certs/ca.srl Updates CA serial file to match regenerated certs.
nsqd/test/certs/ca.pem Regenerated CA certificate fixture.
nsqd/test/certs/ca.key Regenerated encrypted CA private key fixture.
nsqd/test/cert.sh Updates OpenSSL args to explicitly generate RSA-2048/SHA256 CA.
nsqd/tcp.go Explicitly discards send/close errors (errcheck compliance).
nsqd/statsd.go Explicitly discards statsd client errors and flush/close errors.
nsqd/stats_test.go Stops ignoring put/close/start-timeout errors; updates snappy writer usage.
nsqd/protocol_v2.go Checks deadline-setting errors; handles StartInFlightTimeout errors.
nsqd/options.go Handles io.WriteString return per stricter checking.
nsqd/nsqd.go Uses strings.ReplaceAll; improves close/unlock error handling; adjusts TLS client auth default.
nsqd/nsqd_test.go Stops ignoring cleanup and Put/Persist/Delete errors; fixes TestReconfigure port propagation; simplifies waits.
nsqd/lookup.go Stops ignoring peer close errors; checks initial peer command start.
nsqd/lookup_peer.go Checks deadline setting; stops ignoring close errors on failure paths.
nsqd/http.go Uses keyed http_api.Err; checks PersistMetadata errors; stops ignoring write errors in a few paths.
nsqd/http_test.go Adds file-level errcheck suppression and updates many defers/close calls.
nsqd/client_v2.go Uses snappy buffered writer, tracks it for Flush; checks TLS deadlines.
nsqd/channel.go Propagates/handles errors for client close, empty/flush, and requeue put paths.
nsqd/channel_test.go Stops ignoring cleanup, in-flight, requeue, empty, and close errors in tests.
nsqadmin/test/server.req Regenerated TLS CSR fixture.
nsqadmin/test/server.pem Regenerated server certificate fixture.
nsqadmin/test/server.key Regenerated server private key fixture (PKCS8).
nsqadmin/test/client.req Regenerated TLS CSR fixture.
nsqadmin/test/client.pem Regenerated client certificate fixture.
nsqadmin/test/client.key Regenerated client private key fixture (PKCS8).
nsqadmin/test/ca.srl Updates CA serial file to match regenerated certs.
nsqadmin/test/ca.pem Regenerated CA certificate fixture.
nsqadmin/test/ca.key Regenerated encrypted CA private key fixture.
nsqadmin/nsqadmin.go Checks/logs response body close and listener close errors.
nsqadmin/nsqadmin_test.go Stops ignoring cleanup and response-body close errors.
nsqadmin/http.go Adds template execute error handling; updates http_api.Err keyed fields; updates sort wrapper struct usage; uses ReplaceAll.
nsqadmin/http_test.go Stops ignoring cleanup and response-body close errors; checks PutMessage errors in setup.
internal/writers/spread_writer.go Stops ignoring write errors during flush loop.
internal/test/assertions.go Adds t.Helper() to custom assertions for better failure attribution.
internal/statsd/host.go Uses strings.ReplaceAll for host key normalization.
internal/lg/lg.go Explicitly discards logger.Output error return.
internal/http_api/compress.go Explicitly discards gzip/flate Close errors in defers.
internal/http_api/api_response.go Checks response write errors in PlainText; improves JSON error body on marshal failure; explicitly discards handler return values in Decorate.
internal/http_api/api_request.go Changes response body close handling for GETV1/POSTV1.
internal/dirlock/dirlock.go Ensures Unlock returns flock error vs close error deterministically.
internal/clusterinfo/types.go Updates semver import to /v4.
internal/clusterinfo/data.go Updates semver import to /v4.
go.sum Updates dependency checksums for bumped dependencies.
go.mod Updates go directive and bumps/updates module dependencies.
coverage.sh Removes goveralls push path and simplifies package enumeration.
bench/bench_writer/bench_writer.go Stops ignoring socket and protocol I/O errors in benchmarks.
bench/bench_reader/bench_reader.go Stops ignoring socket/protocol I/O and flush/finish errors in benchmarks.
bench/bench_channels/bench_channels.go Stops ignoring socket/protocol I/O and flush/finish errors in benchmarks.
apps/to_nsq/to_nsq.go Updates go-nsq ConfigFlag usage to keyed field.
apps/nsqlookupd/main.go Checks flag parsing errors; checks Stop() error in failure path.
apps/nsqlookupd/main_test.go Checks flag parsing errors.
apps/nsqd/main.go Checks flag parsing errors; checks Stop() error in failure path.
apps/nsqd/main_test.go Checks flag parsing/decode/close/new errors.
apps/nsqadmin/main.go Checks flag parsing errors; checks Stop() error in failure path.
apps/nsqadmin/main_test.go Checks flag parsing errors.
apps/nsq_to_nsq/nsq_to_nsq.go Updates go-nsq ConfigFlag usage to keyed field.
apps/nsq_to_http/nsq_to_http.go Checks io.Copy and response-body close errors; updates ConfigFlag usage.
apps/nsq_to_file/nsq_to_file.go Checks flag parsing and ConfigFlag.Set errors; uses keyed ConfigFlag field.
apps/nsq_to_file/file_logger.go Uses strings.ReplaceAll for token replacement.
apps/nsq_tail/nsq_tail.go Updates ConfigFlag usage; changes default channel generation behavior.
.github/workflows/test.yml Refreshes runner, Go matrix, linting, and coverage action usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/http_api/api_request.go
Comment thread internal/http_api/api_request.go
Comment thread apps/nsq_tail/nsq_tail.go
Comment thread nsqd/nsqd.go
@jehiah
jehiah marked this pull request as ready for review July 16, 2026 16:49
@jehiah
jehiah requested review from mreiferson and ploxiln July 16, 2026 16:49
@jehiah
jehiah merged commit 72ad9b2 into nsqio:master Jul 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants